package com.mashibing.internalcommon.remote;

import com.mashibing.internalcommon.dto.ResponseResult;
import com.mashibing.internalcommon.request.ForecastPriceDTO;
import com.mashibing.internalcommon.request.PointRequest;
import com.mashibing.internalcommon.response.DirectionResponse;
import com.mashibing.internalcommon.response.TerminalResponse;
import com.mashibing.internalcommon.response.TrackResponse;
import com.mashibing.internalcommon.response.TrsearchResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "service-map",path = "/service-map")
public interface ServiceMapClient {

    /**
     * 上传轨迹
     * @param pointRequest
     * @return
     */
    @RequestMapping(method = RequestMethod.POST,value = "/uploadTrack")
    ResponseResult uploadTrack(@RequestBody PointRequest pointRequest);

    @RequestMapping(method = RequestMethod.POST,value = "/addTerminal")
    ResponseResult<TerminalResponse> addTerminal(@RequestParam String name, @RequestParam String desc);

    @RequestMapping(method = RequestMethod.POST,value = "/addTrack")
    ResponseResult<TrackResponse> addTrack(@RequestParam String tid);

    @RequestMapping(method = RequestMethod.POST, value = "/aroundSearch")
    ResponseResult<List<TerminalResponse>> aroundSearch(@RequestParam String center, @RequestParam Integer radius);

    @RequestMapping(method = RequestMethod.POST,value = "/trackSearch")
    ResponseResult<TrsearchResponse> trackSearch(@RequestParam String tid, @RequestParam Long starttime , @RequestParam Long endtime);

    @RequestMapping(method = RequestMethod.GET,value = "/direction/driving")
    ResponseResult<DirectionResponse> direction(@RequestBody ForecastPriceDTO forecastPriceDTO);
}
